import request from '/@/utils/request';
const modulePath = '/workbench';
// 全部事件单查询
export function AllOrderList(query?: any) {
	return request({
		url: `${modulePath}/eventOrder/allOrderListMobile`,
		method: 'POST',
		data: query,
	});
}

//我发起的事件单
export const getMyOrderList = (query: any) => {
	return request({
		url: `${modulePath}/eventOrder/myOrderListMobile`,
		method: 'post',
		data: query,
	});
};

// 事件单来源
export function getAllOrderByName() {
	return request({
		url: `${modulePath}/eventOrder/pageApplicationList`,
		method: 'post',
	});
}

//缓存数据
var SYSDEPTDATA: any = {};
// 获取行政区划接口
export const getSystemArea = async (adcode: any) => {
	if (SYSDEPTDATA.ok) {
		return SYSDEPTDATA;
	}
	const res: any = await request({
		url: `/admin/sysArea/areaTree`,
		method: 'get',
		params: {
			adcode,
		},
	});
	SYSDEPTDATA = res.ok ? res : {};
	return res;
};
